<?php



namespace App\Zesow;

use App\Services\Base\Interfaces\ConfigServiceInterface;
use App\Services\Base\Services\ConfigService;
use App\Services\Work\Models\Company;
use EasyWeChat\Factory;


class WechatOpenPlatform
{
    private static $instance = null;

    private function __construct()
    {
    }


    public static function getInstance($corpId = 0)
    {
        if (!self::$instance) {
            /**
             * @var ConfigService $configService
             */
            $configService = app()->make(ConfigServiceInterface::class);
            $config = $configService->getWechatOpenPlatformConfig();
            self::$instance = Factory::openPlatform($config);
        }
        return self::$instance;
    }
}
